package com.woniuxy.util;

import com.woniuxy.entity.Person;

import java.io.InputStream;
import java.util.Properties;

/**
 * @author: wgt
 * Date: 2021/11/9:16:33
 * Description:
 */
public class ThiredFactory {
    public Person doPerson(){
        Properties properties = new Properties();
        String path="../doPerson.properties";
        InputStream resourceAsStream = ThiredFactory.class.getResourceAsStream(path);
        String personName=null;
        Person person=null;
        try {
            properties.load(resourceAsStream);
         personName= properties.getProperty("person");
         person=(Person) Class.forName(personName).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
            return person;
    }

}
